<?php
namespace Transform;

class OrderTransform extends Transform
{
    public function listview()
    {
        return [
            'allows' => ['order_id', 'shop_id', 'user_id', 'total_price', 'create_time', 'status', 'express_fee', 'order_no', 'items', 'receive_addr', 'shop', 'express_no', 'is_commented','expessname'],
            'shop' => ['trans' => ['name' => 'Shop', 'method' => 'listview']],
            'receive_addr' => ['trans' => ['name' => 'OrderAddr', 'method' => 'listview']],
            'items' => ['trans' => ['name' => 'OrderGoods', 'method' => 'listview']],
        ];
    }

    public function detail()
    {
        return [
            'allows' => ['order_id', 'shop_id', 'user_id', 'total_price', 'create_time', 'status', 'express_fee', 'order_no', 'items', 'receive_addr', 'shop', 'express_no', 'paid_time', 'delivered_time', 'received_time','surplus_time','is_commented','expessname'],
            'shop' => ['trans' => ['name' => 'Shop', 'method' => 'detail']],
            'receive_addr' => ['trans' => ['name' => 'OrderAddr', 'method' => 'detail']],
            'items' => ['trans' => ['name' => 'OrderGoods', 'method' => 'detail']],
        ];
    }


}
